<?php
class program{

	function selectProgram()
	{
		global $con;
		$sql="select * from tbl_program";
		$res = mysqli_query($con,$sql);
		return $res;
	}/// EOF
	
	function addProgram($prog_name,$prog_add_date)
	{
		global $con;
		$sql="INSERT INTO tbl_program SET program_name='$prog_name', program_added_date='$prog_add_date'";
		mysqli_query($con,$sql);
	}/// EOF
	function deleteProgram($id)
	{
		global $con;
		$sql="DELETE FROM tbl_program WHERE program_id='$id' ";
		mysqli_query($con,$sql);
		}
	function editProgram($progId,$progName,$date)
	{
		global $con;
		$sql="UPDATE tbl_program SET program_name='$progName',program_added_date='$date' WHERE program_id='$progId'";
		mysqli_query($con,$sql);
	}	
	function getProgramById($id)
	{
		global $con;
		$sql="SELECT *FROM tbl_program WHERE program_id='$id'";
		$res=mysqli_query($con,$sql);
		return $res;	
	}
	
}//EOC


$objProgram=new program();
?>
